package ro.cityprojects.adminloc.entities;

import javax.persistence.*;
import java.util.Set;

/**
 * Relationships class
 *
 * @author bogdan.solga
 *
 * Date: 13.06.2013, time: 17:47
 */
@Entity
public class Relationships {
    @Id
    @Column(name = "RELATIONSHIP_ID", nullable = false, insertable = true, updatable = true, length = 0, precision = -127)
    private Integer relationshipId;

    public Integer getRelationshipId() {
        return relationshipId;
    }

    public void setRelationshipId(Integer relationshipId) {
        this.relationshipId = relationshipId;
    }

    @Column(name = "NAME", nullable = false, insertable = true, updatable = true, length = 32, precision = 0)
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @OneToMany(mappedBy = "relationshipsByRelationshipId")
    private Set<PersonApartment> personApartmentsByRelationshipId;

    public Set<PersonApartment> getPersonApartmentsByRelationshipId() {
        return personApartmentsByRelationshipId;
    }

    public void setPersonApartmentsByRelationshipId(Set<PersonApartment> personApartmentsByRelationshipId) {
        this.personApartmentsByRelationshipId = personApartmentsByRelationshipId;
    }
}
